<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>系统日志 - S2M Admin</title>

		<meta name="description" content="Static &amp; Dynamic Tables" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<#include "/admin/include/cssjs_up.html" encoding="UTF-8"/>
	</head>

	<body>
		<#assign adminMenuPosFlag="sysLog">
		<#include "/admin/include/head.html" encoding="UTF-8"/>
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<#include "/admin/include/menu.html" encoding="UTF-8"/>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="/admin/">Home</a>
							</li>
							<li class="active">系统日志</li>
						</ul><!-- .breadcrumb -->
					</div>

					<div class="page-content">
						<div class="page-header">
							<h1>
								列表
								<small>
									<i class="icon-double-angle-right"></i>
									系统操作日志
								</small>
							</h1>
							<div class="hr-18"></div>
							<button class="btn btn-primary" onclick="clearLogs()">
								<i class="icon-plus align-top bigger-125"></i>
								清空日志
							</button>
						</div><!-- /.page-header -->

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<div class="row">
									<div class="col-xs-12">
										<div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th>编号</th>
														<th>级别</th>
														<th>名称</th>
														<th>内容</th>
														<th>异常</th>
														<th>时间</th>
														<th>操作</th>
													</tr>
												</thead>

												<tbody>
													<#list pageBean.result as bean>
													<tr>
														<td>
														${bean.id}
														</td>
														<td>
														${bean.level}
														</td>
														<td>
														${bean.logger}
														</td>
														<td>
														${bean.message}
														</td>
														<td>
														<#if bean.exception?exists && bean.exception!="">
														${bean.exception}
														<#else>
														-
														</#if>
														</td>
														<td>
														<#if bean.dateAdd?exists>
														${bean.dateAdd?string("yyyy-MM-dd HH:mm:ss")}
														<#else>
														-
														</#if>
														</td>
														<td>
															<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
																<a class="blue" href="/admin/sysLog/view/?id=${bean.id}">
																	<i class="icon-eye-open bigger-120"></i>
																</a>
																<a class="red" href="javascript:" onclick="deleteMsg('${bean.id}')">
																	<i class="icon-trash bigger-120"></i>
																</a>
															</div>
														</td>
													</tr>
													</#list>
												</tbody>
											</table>
											${pageBean.pageToolBar}
										</div><!-- /.table-responsive -->
									</div><!-- /span -->
								</div><!-- /row -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
			</div><!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<#include "/admin/include/cssjs_down.html" encoding="UTF-8"/>
		<script src="/assets/js/bootbox.min.js"></script>
		<script type="text/javascript">
		function deleteMsg(id){
			bootbox.confirm("确定要删除吗?", function(result) {
				if(result) {
					$.ajax({
						url:"/admin/sysLog/del/",
						type:"POST",
						data:{"id":id,"rnd":Math.random(),"token":"${token}"},
						success:function(a){
							if(a == "success"){
								location.reload();
							}else{
								alert("删除失败" + a);
							}
						}
					});
				}
			});
		}
		function clearLogs(){
			$.ajax({
				url:"/admin/sysLog/clearLogs/",
				type:"POST",
				data:{"rnd":Math.random(),"token":"${token}"},
				success:function(a){
					if(a == "success"){
						location.reload();
					}else{
						alert("删除失败" + a);
					}
				}
			});
		}
		</script>
	</body>
</html>